import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  JdSaleOutWarehouseOrder1VO,
  JdSaleOutWarehouseOrder1Form,
  JdSaleOutWarehouseOrder1Query
} from '@/api/jdAndJstSceneClassification/shanmuConsignmentSale/jdSaleOutWarehouseOrder1/types';

/**
 * 查询金蝶-销售出库单列表
 * @param query
 * @returns {*}
 */

export const listJdSaleOutWarehouseOrder1 = (query?: JdSaleOutWarehouseOrder1Query): AxiosPromise<JdSaleOutWarehouseOrder1VO[]> => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-销售出库单列表
 * 01、定义后端接口
 * @param query
 * @returns {*}
 */

export const listJdSaleOutWarehouseOrder1ByCustomer2 = (query?: JdSaleOutWarehouseOrder1Query): AxiosPromise<JdSaleOutWarehouseOrder1VO[]> => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder/list-by-customer2',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-销售出库单详细
 * @param id
 */
export const getJdSaleOutWarehouseOrder1 = (id: string | number): AxiosPromise<JdSaleOutWarehouseOrder1VO> => {
  return request({
    url: '//dataCheck/jd/saleOutWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增金蝶-销售出库单
 * @param data
 */
export const addJdSaleOutWarehouseOrder1 = (data: JdSaleOutWarehouseOrder1Form) => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改金蝶-销售出库单
 * @param data
 */
export const updateJdSaleOutWarehouseOrder1 = (data: JdSaleOutWarehouseOrder1Form) => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除金蝶-销售出库单
 * @param id
 */
export const delJdSaleOutWarehouseOrder1 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder/' + id,
    method: 'delete'
  });
};
